using System;
using System.Collections;
using CE.Database;
/// <summary>
/// Summary description for UserProfileDB
/// </summary>
/// 
namespace CE.User
{
    public class UserSubscriberDB
    {
        public UserSubscriberDB()
        {
            //
            // TODO: Add constructor logic here
            //
            
        }

        public Int64 Insert(UserSubscriber usersub)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocCESubscriberInsertUpdateSingleItem]";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@SubscribeID", usersub.SubscriberID);
            _sPara.Add("@Email", usersub.Email);
            _sPara.Add("@Info1", usersub.Info1);
            _sPara.Add("@Info2", usersub.Info2);
            _sPara.Add("@Info3", usersub.Info3);
            _sPara.Add("@Info4", usersub.Info4);
            _sPara.Add("@Info5", usersub.Info5);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

        public Int64 AlreadyExist(string Email)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocCESubscriberCheckAlreadyExist]";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@Email", Email);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

        public Int64 AlreadyExist(string Email, bool Status)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocCESubscriberCheckAlreadyExist]";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@Email", Email);
            _sPara.Add("@Status", Status);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

        public bool Update()
        {
            return true;
        }

        public bool Delete()
        {
            return true;
        }

    }
}